﻿using System;

namespace YArchitech.Temp
{
	public class HYDuctElbow : HYDuctFitting
	{
		public bool IsHorizontal { get; set; }

		public HYDuctElbow()
		{
			base.Name = "弯头";
			this.Angle = 0.0;
			this.m_ShowString = string.Empty;
			this.Curvature = 1.0;
			this.IsHorizontal = true;
		}

		public override string ShowString
		{
			get
			{
				if (string.IsNullOrEmpty(this.m_ShowString))
				{
					this.m_ShowString = ((HYDuctSpecification)base.InPort).ShapeString + string.Format("%.0f°弯头", GeUtils.RToD(this.Angle));
				}
				return this.m_ShowString;
			}
		}

		public double Angle { get; set; }

		public double Curvature { get; set; }

		public override void CalCoefficient()
		{
			base.Coefficient = 0.0;
			if (base.IsRound)
			{
				base.Coefficient = Hydrokinetics.SyphonDragLocalIndexRound(Math.PI - this.Angle, this.Curvature);
			}
			else
			{
				double factor = base.InPort.Factor;
				base.Coefficient = Hydrokinetics.SyphonCLR_Rectangle(Math.PI - this.Angle, 1.0 / factor, this.Curvature);
			}
			base.CoefficientShowString = base.Name;
		}

		public override void Cal(HYSystemOption option)
		{
			base.Cal(option);
		}

		private string m_ShowString = string.Empty;
	}
}
